import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TestTimeTableVO, TestTimeTableForm, TestTimeTableQuery } from '@/api/core/testTimeTable/types';
/**
 * 查询实验课程日历
 * @param query
 * @returns {*}
 */

export const listTestTimeTableCard = (query?: TestTimeTableQuery): AxiosPromise<TestTimeTableVO[]> => {
  return request({
    url: '/core/testTimeTable/table',
    method: 'get',
    params: query
  });
};

/**
 * 查询实验课程列表
 * @param query
 * @returns {*}
 */

export const listTestTimeTable = (query?: TestTimeTableQuery): AxiosPromise<TestTimeTableVO[]> => {
  return request({
    url: '/core/testTimeTable/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询实验课程详细
 * @param id
 */
export const getTestTimeTable = (id: string | number): AxiosPromise<TestTimeTableVO> => {
  return request({
    url: '/core/testTimeTable/' + id,
    method: 'get'
  });
};

/**
 * 新增实验课程
 * @param data
 */
export const addTestTimeTable = (data: TestTimeTableForm) => {
  return request({
    url: '/core/testTimeTable',
    method: 'post',
    data: data
  });
};

/**
 * 修改实验课程
 * @param data
 */
export const updateTestTimeTable = (data: TestTimeTableForm) => {
  return request({
    url: '/core/testTimeTable',
    method: 'put',
    data: data
  });
};

/**
 * 删除实验课程
 * @param id
 */
export const delTestTimeTable = (id: string | number | Array<string | number>) => {
  return request({
    url: '/core/testTimeTable/' + id,
    method: 'delete'
  });
};
